﻿<!-- #include file="function.asp" -->
<%
'注册插件
Call RegisterPlugin("SDOS","ActivePlugin_SDOS")
'挂口部分
Function ActivePlugin_SDOS()
  Call Add_Action_Plugin("Action_Plugin_View_Begin","SDOS_Run()")
  Call Add_Filter_Plugin("Filter_Plugin_TArticle_Build_Template_Succeed","SDOS_Replace")
  
  Call Add_Action_Plugin("Action_Plugin_Catalog_Begin","SDOS_Run()")
  Call Add_Filter_Plugin("Filter_Plugin_TArticleList_Build_Template_Succeed","SDOS_Replace")
End Function

Function SDOS_Run()
  Response.AddHeader "SDOS",SDOS_Path("link")
  Response.Cookies("A_referer") = Request.QueryString("sdos")
End Function

Function SDOS_Replace(ByRef html)
  html = Replace(html,"</head>","<link rel=""SDOS"" href="""&SDOS_Path("link")&"""></head>")
  html = Replace(html,"</head>","<script type=""text/javascript"" src=""" & SDOS_Path("script") & """></script>")
End Function


Function SDOS_Path(Name)
  Dim Path
  Path = "zb_users/PLUGIN/SDOS/"
  Select Case Name
    case "link"
      SDOS_Path = BlogHost&"SDOS/"
    case "script"
      SDOS_Path = BlogHost & Path & "source/plugin.js"
    case "db"
      SDOS_Path = BlogPath & Path & "db/db.json"
  End Select
End Function




Function InstallPlugin_SDOS()

	'用户激活插件之后的操作
	
End Function


Function UnInstallPlugin_SDOS()

	'用户停用插件之后的操作
	
End Function
%>